﻿using Zove.Runtime.Core;

namespace Zove.Runtime.Queries {
    /// <summary>
    /// Query manager
    /// </summary>
    public class QueryManager {
        /// <summary>
        /// Constructor with a language nature
        /// </summary>
        /// <param name="languageNature"></param>
        public QueryManager(ILanguageNature languageNature) {
            LanguageNature = languageNature;
        }

        /// <summary>
        /// Language nature
        /// </summary>
        public ILanguageNature LanguageNature { get; private set; }

        public Query CreateQuery(string query) {
            var parser = new QueryParser(LanguageNature);
            Query q = parser.Parse(query);
            q.LanguageNature = LanguageNature;

            return q;
        }
    }
}